#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) The PyAMF Project.
# 登录
# See LICENSE.txt for details.

import user_module.login as userlogins
logins=userlogins.login()

def user_reg(user_id,user_name,pwd,niakname,sex,email,pic):
    """*
    * 报告影片特征码
    * @param integer user_id 用户ID
    * @param integer user_name 用户名
    * @param integer pwd 密码
    * @param integer niakname 昵称
    * @param list sex 性别 1男 2女
    * @param list email 邮箱
    * @param list pic 头像
    * @return arr
    """
    rets={}
    run= logins.user_reg(user_id,user_name,pwd,niakname,sex,email,pic)
    if(run):
        rets["res"]=True
        rets["msg"]=0
    else:
        rets["res"]=True
        rets["msg"]=0
    return rets

def login(user_id,user_name,pwd):
    """*
    * 登录
    * @param integer user_id 用户ID
    * @param string user_name 用户名
    * @param string pwd 密码
    * @return arr
    """
    rets={}
    run=logins.login(user_id,user_name,pwd)
    if(run):
        rets["res"]=True
        rets["msg"]=0
    else:
        rets["res"]=True
        rets["msg"]=0
    return rets

